import random

def boxlist1(size):
    mybox = []
    for i in range(size):
        abox = []
        for j in range(size):
            a = random.randint(0, 2)
            print(a, end=" ")
            abox.append(a)
        mybox.append(abox)
        print()
    return mybox

def boxlist2(size):
    mybox = []
    for i in range(size):
        abox = []
        for j in range(size):
            a = 0
            abox.append(a)
        mybox.append(abox)
    
    a1 = random.randint(0, size-1)
    a2 = random.randint(0, size-1)
    a3 = random.randint(0, size-1)
    a4 = random.randint(0, size-1)
    while a1 == a3 and a2 == a4: # 防止出现两个点重合
        a3 = random.randint(0, size-1)
        a4 = random.randint(0, size-1)
    mybox[a1][a2] = 1
    mybox[a3][a4] = 1
    
    return mybox


def bigerBox(box):
    size = len(box[0])
    l0 = [0 for i in range(size+2)]
    for i in box:
        i.insert(0, 0)
        i.append(0)
    box.insert(0, l0)
    box.append(l0)
    return box

def show(box):
    for i in box:
        for j in i:
            print(j, end=" ")
        print()

a = boxlist2(5)
b = bigerBox(a)
show(b)

print(b[1][1])


